/*********************************************************************************
 *      Copyright:  (C) 2021 litupei<lismilepei@163.com>
 *                  All rights reserved.
 *
 *       Filename:  prj_iniparser.h
 *    Description:  This file is prj_iniparser.h
 *                 
 *        Version:  1.0.0(2021年08月08日)
 *         Author:  litupei <lismilepei@163.com>
 *      ChangeLog:  1, Release initial version on "2021年08月08日 23时23分47秒"
 *                 
 ********************************************************************************/

#ifndef _PRJ_INIPARSER_H_
#define _PRJ_INIPARSER_H_
 
#include <stdio.h>
#include <errno.h>

#include "iniparser.h"
#include "dictionary.h"
#include "prj_mosquitto_thread.h"
#include "prj_zlog.h"
#include "sqlite3.h"

typedef struct mqtt_cxt_s
{
     char                   username[64];
     char                   pub_password[64];
     char                   sub_password[64];
     char                   host[64];
     char                   pub_client[64];
     char                   sub_client[64];
     int                    port;
     int                    keepalive;
     char                   pub_topic[64];
     char                   sub_topic[64];
     int                    pub_mid;
     int                    sub_mid;
     char                   *pub_payload;
     char                   sub_payload[512];
     char                   ZLOG_CONF_PATH[64];
     zlog_category_t        *zlog;
     int                    sq_id;
     sqlite3                *db;
     float                  temp;
     char                   *timenow;

}mqtt_cxt_t;

int ini_mqttmsg(const char *PATH_ini, mqtt_cxt_t *mqtt);
 
#endif
